package com.joysuch.wwyt.datasync.util;

import com.baomidou.mybatisplus.annotation.TableName;

import javax.persistence.Table;

public class DataSyncUtils {

    public static String getTableName(Class domainClass) {
        Table ta = (Table) domainClass.getAnnotation(Table.class);
        if(ta != null) {
            return ta.name();
        }
        TableName tableName = (TableName) domainClass.getAnnotation(TableName.class);
        if(tableName != null) {
            return tableName.value();
        }
        return null;
    }
}
